home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_8003.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  104 lines

  1. -- card: 8003 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2612
  5. -- name: CheckMenu
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A003
  11. -- rect: left=82 top=302 right=324 bottom=182
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Install
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if the optionkey is down then
  23.     pass mouseup
  24.   end if
  25.  
  26.   put (long name of this stack) into sourceStack
  27.   delete first word of sourceStack
  28.   delete first character of sourceStack
  29.   delete last character of sourceStack
  30.   put "Select a stack to copy this resource into."
  31.   put filename("STAK") into fname
  32.   if fname is empty then
  33.     hide message window
  34.     exit mouseup
  35.   end if
  36.   if sourcestack=fname then
  37.     beep
  38.     Answer "Get real.  You can't install it in this stack"
  39.     hide message window
  40.     exit mouseup
  41.   end if
  42.  
  43.   --
  44.   ModResCopy sourceStack,fname,"XCMD","CheckMenu"
  45.   --
  46.   get the result
  47.   if first char of it is "E" then
  48.     put it into the message box
  49.     beep
  50.     answer "Attempt to install resource has failed."
  51.   else
  52.     beep
  53.     answer "Resource installation successful"
  54.   end if
  55.   hide message window
  56. end mouseUp
  57.  
  58.  
  59.  
  60. -- part contents for background part 2
  61. ----- text -----
  62. CheckMenu
  63.  
  64. -- part contents for background part 13
  65. ----- text -----
  66. 14
  67.  
  68. -- part contents for background part 3
  69. ----- text -----
  70.  
  71. CheckMenu lets you add and remove check marks for items in menus you've created using the NewMenu* XFCN.  Examples:
  72.  
  73.   CheckMenu myMenu, 2, TRUE
  74.   CheckMenu myMenu, 3, (the userLevel>2)
  75.  
  76. The first example will place a check mark next to the second menu item in menu "myMenu".  The second example will place a check mark next to the third item in "myMenu" IF the userLevel is greater than 2.
  77.  
  78. The menu number you provide to to CheckMenu should be the same number that was returned by NewMenu.
  79.  
  80. •••
  81.  
  82. All the credit, (even the descriptions above) go to the creator of this ingenious XCMD:
  83.  
  84. Nine to Five Software Company
  85. P.O. Box 915
  86. Greenwood, IN  46142
  87. (317) 887-2154
  88. & Michael Long
  89.  
  90. See also NewMenu*, EnableMenu*, DeleteMenu*,  ChangeMenu*, and ShowMenu*
  91.  
  92.  
  93. -- part contents for background part 10
  94. ----- text -----
  95. Syntax:
  96.  
  97. CheckMenu <menuNumber>,
  98. <itemNumber>,TRUE/FALSE
  99.  
  100. <menuNumber> is the MenuID that was returned by NewMenu when the menu was created.
  101.  
  102. <itemNumber> is the number of the item in the menu (starting at 1 for the first item in the menu .)
  103.  
  104. TRUE checks that item.  FALSE unchecks the item.